<template>
    <el-card class="wly-page">
        <v-header title="工作台"></v-header>
        <!--将前分四块-->
        <el-row :gutter="24">
            <el-col :span="12" >
                <!--第一块-->
                <el-card style="height: 300px" >
                    <div v-if="workBoard.length > 0 && workBoard[0].lookStatus === '1'">
                        <AInitPageCom title="头寸日报查询"></AInitPageCom>
                        <component style="width: 100%;height: 200px" :is="item1"></component>
                        <!--更多-->
                        <AButton @click="goToPosition" style="margin-left: 90%" button-name="更多"></AButton>
                    </div>
                </el-card>
            </el-col>
            <el-col :span="12">
                <!--第二块-->
                <el-card style="height: 300px" >
                    <div v-if="workBoard.length > 0 && workBoard[1].lookStatus === '1'">
                        <AInitPageCom title="投融资计划查询"></AInitPageCom>
                        <component style="width: 100%;height: 200px" :is="item2"></component>
                        <!--更多-->
                        <AButton @click="goToPlan" style="margin-left: 90%" button-name="更多"></AButton>
                    </div>
                </el-card>
            </el-col>
        </el-row>
        <el-row style="margin-top: 10px" :gutter="24">
            <el-col :span="12">
                <!--第三块-->
                <el-card style="height: 300px" >
                    <div v-if="workBoard.length > 0 && workBoard[2].lookStatus === '1'">
                        <AInitPageCom title="xxxx"></AInitPageCom>
                        <!--                    <component style="width: 100%;height: 200px" :is="item1"></component>-->
                        <!--更多-->
                        <!--                    <AButton @click="xxx" style="margin-left: 540px" button-name="更多"></AButton>-->
                    </div>

                </el-card>
            </el-col>
            <el-col :span="12">
                <!--第四块-->
                <el-card style="height: 300px">
                    <div v-if="workBoard.length > 0 && workBoard[3].lookStatus === '0'">
                        <AInitPageCom title="xxxx"></AInitPageCom>
                        <!--                    <component style="width: 100%;height: 200px" :is="item1"></component>-->
                        <!--更多-->
                        <!--                    <AButton @click="xxx" style="margin-left: 540px" button-name="更多"></AButton>-->
                    </div>
                </el-card>
            </el-col>
        </el-row>
    </el-card>
</template>

<script type="text/ecmascript-6">
    import ajax from '@api/ajax'
    import {
        GET_WORKBOARD_BYUSER
    } from '@api/url'
    export default {
        name: 'dataBoard',
        data () {
          return {
              item1: 'PositionDaily',
              item2: 'FundingPlan',
              workBoard: []
          }
        },
        methods: {
            goToPosition () {
                this.$router.push('/home/CashDailyList')
            },
            goToPlan () {
                this.$router.push('/home/IfbScalePlanListQry')
            },
            // 查询用户工作台权限
            qryWorkBoard () {
                let _this = this
                _this.userName = sessionStorage.getItem('userName')
                ajax.post(GET_USER_MENU, {
                    userName: _this.userName
                }).then(res => {
                    _this.workBoard = res.data
                    // _this.menuData = this.formatToTree(res.data);
                }).finally(() => {
                })
            }
        },
		created () {
		}
      }
</script>

<style lang="stylus" rel="stylesheet/stylus" scoped>
</style>
